package com.baitai.system.mapper;

import java.util.Date;
import java.util.List;
import com.baitai.system.domain.PrizeDrawRule;
import com.baitai.system.domain.PrizeDrawRuleProductRelation;
import com.baitai.system.domain.vo.PrizeDrawRuleVo;
import org.apache.ibatis.annotations.Param;

/**
 * 抽奖规则Mapper接口
 * 
 * @author ruoyi
 * @date 2024-07-11
 */
public interface PrizeDrawRuleMapper 
{
    /**
     * 查询抽奖规则
     * 
     * @param id 抽奖规则主键
     * @return 抽奖规则
     */
    public PrizeDrawRule selectPrizeDrawRuleById(Long id);

    /**
     * 查询抽奖规则列表
     * 
     * @param prizeDrawRule 抽奖规则
     * @return 抽奖规则集合
     */
    public List<PrizeDrawRule> selectPrizeDrawRuleList(PrizeDrawRule prizeDrawRule);

    /**
     * 新增抽奖规则
     * 
     * @param prizeDrawRule 抽奖规则
     * @return 结果
     */
    public int insertPrizeDrawRule(PrizeDrawRule prizeDrawRule);

    /**
     * 修改抽奖规则
     * 
     * @param prizeDrawRule 抽奖规则
     * @return 结果
     */
    public int updatePrizeDrawRule(PrizeDrawRule prizeDrawRule);

    /**
     * 删除抽奖规则
     * 
     * @param id 抽奖规则主键
     * @return 结果
     */
    public int deletePrizeDrawRuleById(Long id);

    /**
     * 批量删除抽奖规则
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePrizeDrawRuleByIds(Long[] ids);

    PrizeDrawRuleVo selectPrizeDrawRuleVoById(Long id);

    int insertRelation(List<PrizeDrawRuleProductRelation> relation);

    void deleteRelation(Long id);

    String selectPrizeDrawRuleProductNumber(@Param("prizeDrawRuleId")Long prizeDrawRuleId,@Param("productId")Long productId);

    void updateProductNumber(@Param("prizeDrawRuleId")Long prizeDrawRuleId,@Param("productId")Long productId, @Param("productNumber")String productNumber);

    List<PrizeDrawRuleVo> getPrizeDraw(@Param("currDate")String date);
}
